const express = require("express");
const router = require("../route.js"); // 引入路由
 
var app = express();
 
app.all("*", function (req, res, next) { //配置预检请求
  // console.log(req.method);
 
  res.header("Access-Control-Allow-Origin", "*");
  res.header("Access-Control-Allow-Headers", "Content-type");
  res.header("Access-Control-Allow-Methods", "POST,GET,OPTIONS");
  res.header("Access-Control-Max-Age", 1728000); //预请求缓存20天
  next();
 
});
 
app.use(`/pay`, router); 
 
app.listen("8085", () => {//端口监听
  console.log("8085 port is start");
});